var loginValidator;
var editor;

var modelObject = {
	init:function(){
		//--表单验证 start--
		loginValidator = $("#addCustomerForm").validate
		({
			rules: {
				loginId:{
					required:true,
					number: true,
					min:0
				},
				name: {
					required:true,
					maxlength:255
				},
				password: {
					required: true,
					minlength:6
				},
				sure:{
					required: true,
                    equalTo: "#password"
				}
			},
			messages:{
				loginId:{
					required:"请填写登录ID",
					number:"请填写正确的登录ID"
				},
				name:{
					required:"请填写登录名",
					maxlength:"活动名称不能超过255个字"
				},
				password: {
					required: "请填写密码",
					minlength: "密码至少6位"
				},
				sure:{
					required: "请确认密码",
                    equalTo: "两次密码不一致"
				}
			},
			submitHandler:function(form){
				//--- 富文本框内容特殊处理 start ---
				editor.sync();
				//--- 富文本框内容特殊处理 end ---
				
				form.submit();
			}
		});
		//-- 表单验证 end --
	}
};


$(document).ready(function(){
	modelObject.init();
	
});